#!/usr/bin/env python
"""
ApacheCtl.py

This module is to interface with apachectl to control apache itself.
Possible reasons are to: start, stop, or restart apache

"""

import os, sys

def start():
    return os.spawnvp(os.P_WAIT, 'sudo',
                      ['sudo', 'apache2ctl', 'start'])

def stop():
    return os.spawnvp(os.P_WAIT, 'sudo',
                      ['sudo', 'apache2ctl', 'stop'])

def restart():
    return os.spawnvp(os.P_WAIT, 'sudo',
                      ['sudo', 'apache2ctl', 'restart'])

def gracefulrestart():
    return os.spawnvp(os.P_WAIT, 'sudo',
                      ['sudo', 'apache2ctl', 'graceful'])

#        os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDIDemo.py")
